package org.streets.context;

public interface HiveRegistry {
    /**
     * Locates a service given just a service interface. A single service must implement the service interface (which
     * can be hard to guarantee). The search takes into account inheritance of the service interface (not the service
     * <em>implementation</em>), which may result in a failure due to extra matches.
     *
     * @param <T>
     * @param intf the interface the service implements
     * @return the service's proxy
     * @throws RuntimeException if the service does not exist (this is considered programmer error), or multiple
     *                          services directly implement, or extend from, the service interface
     */
    public abstract <T> T service(Class<T> intf);

	/**
	 * Invoke service.
	 *    
	 * @param <T>
	 * @param id service identifier
	 * @param intf
	 * @return Hivemind Service-Point
	 */
	public abstract <T> T service(String id, Class<T> intf);
    /**
     * 
     * @param <T>
     * @param interfaceClass
     * @param implementationClass
     * @return Proxy Object
     */
    public abstract <T> T proxy(Class<T> interfaceClass, Class<? extends T> implementationClass);
	/**
	 * Get property value 
	 * @param symbol
	 * @return
	 */
	public abstract String symbolValue(String symbol);    
	/**
	 * @param input
	 * @return
	 */
	public abstract String expandSymbol(String input);
    
	/**
	 * Prepare for thread mode
	 */
	public abstract void setupThread();
	/**
	 * Clear for thread mode
	 *
	 */
	public abstract void cleanupThread();

//    /**
//     * Invoked to eagerly load services marked with the {@link EagerLoad} annotation, and to execute all contributions
//     * to the Startup service.
//     */
//	public abstract void startup();
//	
//	/**
//	 * Shutdown hive context
//	 *
//	 */
//	public abstract void shutdown();
}
